package thread09.thread;

class MyThread5 implements Runnable
{
	private String name;
	
	public MyThread5()
	{
		
	}
	public MyThread5(String name)
	{
		super();
		this.name = name;
	}

	@SuppressWarnings("static-access")
	public void run()
	{
		for(int i=0;i<10;i++)
		{
			System.out.println(Thread.currentThread().getName()+"运行，i="+i);
			if(i == 3)
			{
				Thread.currentThread().yield();
				System.out.print(Thread.currentThread()+"礼让");

			}
				
		}
		
	}
}
public class ThreadDemo08
{


	public static void main(String[] args)
	{
		MyThread5 mt1 = new MyThread5("A");
		new Thread(mt1).start();
		new Thread(mt1).start();
	}

}
